<template>
  <el-container>
    <el-aside width="200px">
      <el-menu
          default-active="1-1"
          class="el-menu-vertical-demo">

        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>导航一</span>
          </template>
            <el-menu-item index="1-1">用户管理</el-menu-item>
            <el-menu-item index="1-2">角色管理</el-menu-item>
            <el-menu-item index="1-3">权限管理</el-menu-item>

        </el-submenu>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>java44-SpringBoot-Vue
        <span>当前用户:{{this.$store.state.username}}</span>
        <el-button type="danger" size="mini" @click="logout">退出</el-button>
      </el-header>
      <el-main>
<!--       表单展示-->
        <!-- 路由填充位(各种组件再次展示) -->
<!--        <router-link to="/admin/user"></router-link>-->

        <router-view></router-view>
      </el-main>
      <el-footer>@2024 Taotie Copyright</el-footer>
    </el-container>
  </el-container>
</template>

<script>
import axios from "axios";

export default {
  name: "AdminView",
  data() {
    return {

    }
  },
  methods: {
    logout(){
      this.$store.commit("clearAwayUser")

      this.$router.push("/")
    }
  },

}
</script>

<style scoped>
.el-header, .el-footer {
  //background-color: #B3C0D1;
  background-color:#3689bf;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;

}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-container{
  height: 690px;
}
</style>